package refect;


import refect.domain.Person;

public class RefectDemo01 {

    public static void main(String[] args) throws ClassNotFoundException {
        // 1. Class.forName("全类名")
        Class cls1 = Class.forName("refect.domain.Person");
        System.out.println(cls1);

        // 2. 类名.class
        Class cls2 = Person.class;
        System.out.println(cls2);

        // 3. 对象.getClass()
        Person person = new Person();
        Class cls3 = person.getClass();
        System.out.println(cls3);


        // == 比较三个对象 (内存地址)
        System.out.println(cls1 ==  cls2); // true
        System.out.println(cls1 ==  cls3); // true
    }
}
